package com.SDU.policedispatch.mapper;

import com.SDU.policedispatch.entity.Person;
import com.SDU.policedispatch.entity.Schedules;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ScheduleMapper extends BaseMapper<Schedules> {
    @Select("SELECT id, name FROM schedules WHERE main_or_alternate = #{type} AND department_name = #{name}")
    List<Schedules> SelectPerson(@Param("type") String type, @Param("name") String departmentName);
    @Select("SELECT * FROM schedules WHERE leader LIKE CONCAT('%', #{leader}, '%')")
    List<Schedules> SelectByLeader(@Param("leader") String leader);
}
